#include <iostream>
#include <vector>
#include "myh\MemoryPool.hpp"
using namespace std;
class MyClass{
private:
    int a,b;
public:
    MyClass():a(0),b(0){}
    MyClass(int _a,int _b):a(_a),b(_b){}
    MyClass& operator=(const MyClass& other){
        if(this!=&other){
            a=other.a;
            b=other.b;
        }
        return *this;
    }
    MyClass operator+(const MyClass& other)const{
        return MyClass(a+other.a,b+other.b);
    }
    MyClass operator-(const MyClass& other)const{
        return MyClass(a-other.a,b-other.b);
    }
    pair<int,int> get() const{
        return make_pair(a,b);
    }
};
int main(){
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    myh::pool::MemoryPool<MyClass> pool;
    myh::pool::Ptr<MyClass> p1(pool,1,2),p2(pool,3,4);
    MyClass a=*p1+*p2;
    pair<int,int> pa=a.get();
    cout<<"MyClass(1,2)+MyClass(3,4)=MyClass("<<pa.first<<','<<pa.second<<")\n";
    myh::pool::MemoryPool<int> pool2;
    myh::PoolVector<int> vec({1,2,3},myh::PAlloc<int>(pool2));
    cout<<"Allocated count:"<<pool2.getAllocatedCount()<<'\n';
    cout<<"vec:";
    for(auto& i:vec) cout<<i<<' ';
    cout<<'\n';
    return 0;
}